package com.naiterui.ehp.bs.cms.modules.oms.feign;

import java.util.Set;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.cms.modules.oms.vo.UpdateOrderVO;

/**
 * 订单远程接口
 *
 * @author wangzehao
 * @date 2019-01-28 11:42
 * @since 1.0.0
 */
@RequestMapping("/inner/cms/orders")
@FeignClient(name = "order", url = "${ehp.domain.b2c}", configuration = FeignConfiguration.class)
public interface IOrderFeignClient {

    @PostMapping("/audit")
    void audit(@RequestBody Set<Long> orderIds) throws BusinessException;

    @PostMapping("/return/audit")
    void returnAudit(Set<Long> orderIds) throws BusinessException;

    /**
     * 取消订单
     */
    @PutMapping("/cancel")
    void cancel(@RequestBody Set<Long> orderIds) throws BusinessException;

    /**
     * 修改订单
     */
    @PostMapping
    void update(@RequestBody UpdateOrderVO updateOrder) throws BusinessException;

}
